<template>
    <a-form ref="userForm" :form="userForm" layout="inline">
        <a-form-item>
            <a-input v-model="query.dataFormId" allowClear placeholder="请输入表单ID" />
        </a-form-item>
        <a-form-item>
            <a-input v-model="query.dataFormName" allowClear placeholder="请输入表单名称" />
        </a-form-item>
        <a-form-item>
            <a-button type="primary" class="mr5" icon="search" @click="$emit('search', query)">查询</a-button>
            <a-button class="mr5" icon="redo" @click="handleReset">重置</a-button>
        </a-form-item>
        <a-form-item class="fr" style="margin-right: 0">
            <a-button type="primary" icon="plus" @click="$emit('add')">新增</a-button>
        </a-form-item>
    </a-form>
</template>

<script>
export default {
    name: 'FormListSearch',
    data() {
        return {
            userForm: this.$form.createForm(this),
            // 查询参数
            query: {
                dataFormId: null,
                dataFormName: null
            }
        };
    },
    methods: {
        handleReset() {
            this.query = {
                dataFormId: null,
                dataFormName: null
            };
        }
    }
};
</script>
